// header / 所有分类 / 点击动画
var all_class_h2 = $(".header_bottom .all_class h2"),
    all_class_ul = $(".header_bottom .all_class ul");
all_class_h2.on("click",function(){
  if(all_class_ul.css("display") == "none"){
    all_class_ul.slideDown(500);
  }else{
    all_class_ul.slideUp(500);
  }
})

// 往期艺网之星  / 切换按钮
var turnleft_btn = $(".turn_left"),
    turnright_btn = $(".turn_right");
turnleft_btn.on("click",function(){
  $(".previous_star_bottom").stop().animate({
    "left":"-400px"
  },400)
})
turnright_btn.on("click",function(){
  $(".previous_star_bottom").stop().animate({
    "left":"0px"
  },400)
})

// 艺术家索引 / 获取目录
var letters_f = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
for(var i = 0;i < letters_f.length;i++){
  var list = (`<b href="">${letters_f[i]}</b>`);
  $(".indexes_top .list").append(list);
}

// 艺术家索引 / 获取作家列
// artist_data

// 获取当前艺术家首字母
function gainartist(){
  var artist_f = $(".indexes_bottom span").text();
  var artists = artist_data.content_name;
  for(var j = 0;j < artists.length;j++){
    var f = artists[j].artist_f,
        n = artists[j].artist_name,
        p = artists[j].artist_photo;
    if(artist_f == f){
      var li = (`<li>
                <a href="">
                  <img src="${p}" alt="">
                <div class="name">${n}</div>
                </a>
              </li>`);
      $(".indexes_bottom ul").append(li);
    }
  }
}
// 页面加载完调用一次
gainartist();


// 艺术家索引 / 选择首字母
var check_f = $(".list b");
check_f.on("click",function(){
  $(".list b").css({"font-weight":"normal"});
  $(this).css({"font-weight":"bold"});
  var a_f = $(this).text();
  var ysj_f = $(".indexes_bottom span");
  ysj_f.text(a_f);
  $(".indexes_bottom ul").empty();
  gainartist();
})
